package basic;

import nsl.com.util.excel.basic.UtilExcelLocate;
import nsl.com.util.excel.basic.UtilExcelWorkBookAndSheet;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Sheet;
import org.junit.Test;

import java.io.IOException;

/**
 * Description:
 * Created by E460 on 2017/10/23.
 */
public class Demo1 {

    @Test
    public void findMaxValidatedRowTest() throws IOException, InvalidFormatException {
        String fileAbsPath="D:\\Programming\\Project\\IntelliJ_IDEA_2017\\Util_Excel_10_22_pm20\\Util_Excel\\src\\main\\resources\\distribute\\网格验收单(模板)_汇总表_v2.xls";
        String sheetName="Summary";
        Sheet sheet= UtilExcelWorkBookAndSheet.getSheet(fileAbsPath,sheetName);
        System.out.println(sheet.getLastRowNum());
        int lastRow=UtilExcelLocate.findMaxValidatedRow(sheet,4);
        System.out.println(lastRow);
    }
}
